/**
 * Copyright (C) 2011 KingCore Science & Technology CO,.LTD. All rights reserved.
 * XNS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/**
 * Copyright (C) 2002-2011 WUZEWEN. All rights reserved.
 * WUZEWEN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 * This software is the confidential and proprietary information of
 * WuZeven, Personal. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with WuZeven.
 */

package wzw.swing.table;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;

import com.kingcore.director.DirectorConstants;

/**
 * <p>java类文件的说明...</p>
 * @author Zeven/wzw on Mar 18, 2011
 * @version	1.0
 * @see		Object#equals(java.lang.Object)
 * @since	JDK5
 */

public class ZebraCrossTableCellRenderer extends DefaultTableCellRenderer implements TableCellRenderer{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public ZebraCrossTableCellRenderer() {
		super();
	}
	
	/**
	 * <p>java方法的说明...</p>
	 * @author Zeven on Mar 18, 2011
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

	@Override
	public Component getTableCellRendererComponent(JTable table,
			Object value, boolean isSelected, boolean hasFocus,
			int row, int column) {
		if (row % 2 == 1)// JTable中的奇数行
		{
			setBackground( DirectorConstants.Color_ZebraCross );
		} else {
			setBackground(Color.WHITE);
		}
		return super.getTableCellRendererComponent(table, value,
				isSelected, hasFocus, row, column);
	}
}
